package com.qingcheng.service.order;

import com.qingcheng.entity.PageResult;
import com.qingcheng.pojo.order.Order;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * order业务逻辑层
 */
public interface OrderService {


    public List<Order> findAll();


    public PageResult<Order> findPage(int page, int size);


    public List<Order> findList(Map<String, Object> searchMap);


    public PageResult<Order> findPage(Map<String, Object> searchMap, int page, int size);


    public Order findById(String id);


    public Map<String,Object> add(Order order);


    public void update(Order order);


    public void delete(String id);

    /**
     * 修改订单状态
     * @param orderId
     * @param transactionId
     */
    public void updatePayStatus(String orderId, String transactionId);

    /**
     * 关闭订单
     * @param orderId
     */
    public void closeOrder(String orderId);

    List<Order> findByUsername(String username);
    //下单人数与付款人数
    public Set<String> findOrdersPeopleNum(LocalDate date);
    public Set<String> findPaymentPeopleNum(LocalDate date);

    //全部订单数,有效订单数,已付订单数
    public int findAllOrderNum(LocalDate date);
    public int findOrderSuccessNum(LocalDate date);
    public int findPayOrderNum(LocalDate date);

    //全部商品数与付款商品数
    public int findAllGoodsNum(LocalDate date);
    public int findPayGoodsNum(LocalDate date);

    //订单总额,退款总额,付款总额
    public int findPlaceMoney(LocalDate date);
    public int findRefundMoney(LocalDate date);
    public int findPayMoney(LocalDate date);
}
